package com.ytjj.qmyx.admin.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.admin.model.request.UsersWithdrawalRequest;
import com.ytjj.qmyx.admin.service.UsersWithdrawalRecordService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *
 *
 * @Version: 1.0
 */
@RestController
@RequestMapping("/usersWithdrawal")
public class UsersWithdrawalController {

	@Resource
	private UsersWithdrawalRecordService usersWithdrawalRecordService;

	@GetMapping("/list")
	public CommonResult selectList(UsersWithdrawalRequest request) {
		return CommonResult.success(usersWithdrawalRecordService.selectList(request));
	}

	@GetMapping("/auditSuccess")
	public CommonResult selectList(@RequestParam Integer id) {
		usersWithdrawalRecordService.auditSuccess(id);
		return CommonResult.success();
	}

	@GetMapping("/auditFail")
	public CommonResult selectList(@RequestParam Integer id, @RequestParam String failReason) {
		usersWithdrawalRecordService.auditFail(id, failReason);
		return CommonResult.success();
	}

	@GetMapping("/withdrawalOpear")
	public CommonResult WithdrawalOpera(@RequestParam Integer id) {
		usersWithdrawalRecordService.withdrawalOpera(id);
		return CommonResult.success();
	}
}
